exports.goods = 'http://ustbhuangyi.com/sell/api/goods'

exports.seller = 'http://ustbhuangyi.com/sell/api/seller'

exports.ratings = 'http://ustbhuangyi.com/sell/api/ratings'

exports.getDataKey = function(url) {
    let apiUrl = url.split('?')[0]
    let result = apiUrl.split('/')[apiUrl.split('/').length-1]
    return result
}
function formatTime(date) {
  var year = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()

  var hour = date.getHours()
  var minute = date.getMinutes()
  var second = date.getSeconds()


  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}

function formatNumber(n) {
  n = n.toString()
  return n[1] ? n : '0' + n
}

module.exports = {
  formatTime: formatTime
}
